package com.ruoyi.lvlian.mapper;

import java.util.List;

import com.ruoyi.lvlian.domain.DriverVehicleRef;
import com.ruoyi.lvlian.domain.VehicleInfo;
import com.ruoyi.lvlian.dto.VehicleInfoDto;
import com.ruoyi.lvlian.vo.VehicleInfoVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 车辆信息Mapper接口
 *
 * @author liyuxi
 * @date 2024-06-06
 */
@Repository
public interface VehicleInfoMapper {
    /**
     * 查询车辆信息
     *
     * @param id 车辆信息主键
     * @return 车辆信息
     */
    public VehicleInfo selectVehicleInfoById(String id);

    /**
     * 查询车辆信息列表
     *
     * @param vehicleInfo 车辆信息
     * @return 车辆信息集合
     */
    public List<VehicleInfoVo> selectVehicleInfoList(VehicleInfoDto vehicleInfo);

    /**
     * 新增车辆信息
     *
     * @param vehicleInfo 车辆信息
     * @return 结果
     */
    public int insertVehicleInfo(VehicleInfo vehicleInfo);

    /**
     * 修改车辆信息
     *
     * @param vehicleInfo 车辆信息
     * @return 结果
     */
    public int updateVehicleInfo(VehicleInfo vehicleInfo);

    /**
     * 删除车辆信息
     *
     * @param id 车辆信息主键
     * @return 结果
     */
    public int deleteVehicleInfoById(String id);

    /**
     * 批量删除车辆信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteVehicleInfoByIds(String[] ids);


    int saveBatchDriverVehicleRef(@Param("dtoList")  List<DriverVehicleRef> dtoList);


    int queryVehicleCountByDriverPhone(@Param("driverPhone")  String driverPhone);

    List<VehicleInfo> queryVehicleListByDriverByPhone(String driverPhoneOrId );
    List<VehicleInfo> queryVehicleListByDriverByLicenseNo(String driverPhoneOrId );

    int batchSave(@Param("dtoList")  List<VehicleInfo> dtoList);

    String queryRecentDriver(String plateNo );
//    void batchDelete( @Param("ids")  String[] ids );

    List<VehicleInfo> queryVehicleListByDriverPhoneOrIdOther(String phoneNo);

    String queryRecentDriverByPhone(String phone);

    int updateImg(@Param("id")String id,  @Param("colName") String colName);


    List<VehicleInfo> queryVehicleListByDriverPhoneOrIdEffective(String driverPhoneOrId);
}
